#ifndef RECEIVE_DEVICE_DATA_H
#define RECEIVE_DEVICE_DATA_H

#include <fstream>
#include <wx/window.h>
#include <wx/progdlg.h>
#include <wx/event.h>

class ReceiveNewEvent : public wxEvent
{
    public:
        ReceiveNewEvent(wxEventType eventType, int winid,long _index) : wxEvent(winid,eventType),index(_index) {}
        long GetIndex() {return index;}
        virtual wxEvent *Clone() const { return new ReceiveNewEvent(*this); }
    private:
        long index;
};

wxDECLARE_EVENT(EVT_RECEIVEFILE_START,ReceiveNewEvent);
wxDECLARE_EVENT(EVT_RECEIVEFILE_STOP,wxCommandEvent);
wxDECLARE_EVENT(EVT_RECEIVEFILE_NEW,ReceiveNewEvent);

class ReveiceDeviceData
{
    public:
        ReveiceDeviceData(std::ofstream* filePtr,wxWindow* win,long allFrameNum);
        bool operator()(const long FrameNum,const char* data);  //处理512KB数据
        virtual ~ReveiceDeviceData();
    private:
        long frameCount=0;
        std::ofstream* filePtr;
        wxWindow* win;
        long AllFrameNum;
};

#endif
